<template>
  <div class="nav-bar">
    <div class="left">
      <span
        :class="['menu-item', { active: currentName === item.name }]"
        @click="menuChange(item)"
        v-for="item in menuList.slice(0, 4)"
        :key="item.name"
        >{{ item.name }}</span
      >
    </div>
    <div class="right">
      <span
        :class="['menu-item', { active: currentName === item.name }]"
        @click="menuChange(item)"
        v-for="item in menuList.slice(4)"
        :key="item.name"
        >{{ item.name }}</span
      >
    </div>
  </div>
</template>

<script>
// iui
export default {
  name: "NavBar",
  components: {},
  data() {
    return {
      currentName: "园区竞争力",
      menuList: [
        { name: "品质管理", path: "/qualityManagement" },
        { name: "服务管理", path: "/serviceManagement" },
        { name: "营运绩效", path: "/operationPerformance" },
        { name: "工厂图", path: "/factoryDrawing" },
        { name: "安全环保", path: "/safetyEnvironmentalProtection" },
        { name: "产线管理看板", path: "/productionManagement" },
        { name: "车间管理平台", path: "/workshopManagement" },
        // { name: "园区竞争力", path: "/parkCompetitiveness" },
        // { name: "产业链协同", path: "/industryChainCollaboration" },
        // { name: "智慧能源", path: "/smartEnergy" },
        // { name: "安全生产", path: "/safety" },
        // { name: "智慧运营", path: "/smartOperations" },
        // { name: "智慧物流", path: "/smartLogistics" },
        // { name: "智慧仓储", path: "/smartWarehousing" },
        // { name: "5G全连接", path: "/fullConnectivity" },
      ],
    };
  },
  computed: {},
  created() {},
  methods: {
    menuChange({name,path}) {
      this.currentName = name;
      this.$router.push(path);
    },
  },
};
</script>

<style scoped lang="scss">
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 52px;
  height: 40%;
  .menu-item {
    margin-right: 15px;
    padding: 6px 25px;
    cursor: pointer;
    font-size: 20px;
    font-style: italic;
    color: #daedff;
    &.active {
      background-image: url("~@/assets/images/menu_active.png");
      background-size: 100% 100%;
    }
  }
}
</style>
